package com.yc.service.impl;

import com.yc.entity.Commentsecord;
import com.yc.mapper.CommentsecordMapper;
import com.yc.service.ICommentsecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;

/**
 * <p>
 * InnoDB free: 4096 kB 服务实现类
 * </p>
 *
 * @author ly
 * @since 2022-06-13
 */
@Service
public class CommentsecordServiceImpl extends ServiceImpl<CommentsecordMapper, Commentsecord> implements ICommentsecordService {
    @Resource
    private CommentsecordMapper commentsecordMapper;

    @Override
    public Integer addReview(Integer cmid, Integer uid, String massage) {
        Commentsecord commentsecord=new Commentsecord();
        commentsecord.setCmid(cmid);
        commentsecord.setUid(uid);
        commentsecord.setCmsdetail(massage);
        commentsecord.setPraisenum(0);
        commentsecord.setStampnum(0);
        commentsecord.setCmsdate(LocalDateTime.now());
        return commentsecordMapper.insert(commentsecord);
    }
}
